#!/usr/bin/env python
PACKAGE = "roboteq_control"

from dynamic_reconfigure.parameter_generator_catkin import *

gen = ParameterGenerator()

# Encoder
enc_config = gen.enum([ gen.const("unused",  int_t, 0, "Unused"),
		         gen.const("command",  int_t, 1, "Command"),
                         gen.const("feedback", int_t, 2, "Feedback")],
                         "configuration")
gen.add("configuration", int_t, 0, "Configuration encoder", 0, 0, 2, edit_method=enc_config)
motor_enable = gen.enum([ gen.const("disabled",  int_t, 0, "Disabled"),
		         gen.const("enabled",  int_t, 1, "enabled")],
                         "Enable feedback from this motor")
gen.add("input_motor_one", int_t, 0, "Configuration pulse input", 0, 0, 2, edit_method=motor_enable)
gen.add("input_motor_two", int_t, 0, "Configuration pulse input", 0, 0, 2, edit_method=motor_enable)

gen.add("PPR",       int_t, 0, "[#] An Integer parameter",        1,  0, 5000)

enc_pos = gen.enum([ gen.const("After",  int_t, 0, "After gears"),
                    gen.const("Before", int_t, 1, "Before gears")],
                    "Position")
gen.add("position", int_t, 0, "Position encoder respect to gears", 1, 0, 1, edit_method=enc_pos)

gen.add("encoder_low_count_limit",  int_t, 0, "[#] Encoder minimum count value", -1000,  -2147000000, 2147000000)
gen.add("encoder_high_count_limit",  int_t, 0, "[#] Encoder maximum count value", 1000,  -2147000000, 2147000000)

gen.add("encoder_home_count",  int_t, 0, "[#] Encoder home count", 0,  -2147000000, 2147000000)

#Default command
gen.add("load_roboteq", bool_t  , 0, "Load all parameters from Roboteq board", False)
gen.add("restore_defaults", bool_t  , 0, "Restore to the original configuration", False)

exit(gen.generate(PACKAGE, "roboteq_node", "RoboteqEncoder"))
